package com.ouc.yyi.test02;

import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        fun1();
    }

    /** 判断中文出现次数 */
    public static void fun1() {
        String string = "我爱你中国,我爱你长城,大爱无疆";
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你要查找的字符：");
        String input = scanner.next();
        String[] array = string.split(input);
        System.out.println(input + " 总共出现了：" + (array.length - 1) + "次");
    }
}
